package com.sugon.service.impl;

import cn.hutool.core.util.RandomUtil;
import com.sugon.dao.ToolsRecordDao;
import com.sugon.entity.ToolsRecordEntity;
import com.sugon.service.ToolsRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 工装台账Service实现类
 *
 * @author sugon
 * @date 2019-07-19 11:16:57
 */
@Service("toolsRecordService")
public class ToolsRecordServiceImpl implements ToolsRecordService {
    @Autowired
    private ToolsRecordDao toolsRecordDao;

    @Override
    public ToolsRecordEntity queryObject(String id) {
        return toolsRecordDao.queryObject(id);
    }

    @Override
    public List<ToolsRecordEntity> queryList(Map<String, Object> map) {
        return toolsRecordDao.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return toolsRecordDao.queryTotal(map);
    }

    @Override
    public int save(ToolsRecordEntity toolsRecord) {
        toolsRecord.setId(RandomUtil.randomString(32));
        return toolsRecordDao.save(toolsRecord);
    }

    @Override
    public int update(ToolsRecordEntity toolsRecord) {
        return toolsRecordDao.update(toolsRecord);
    }

    @Override
    public int delete(String id) {
        return toolsRecordDao.delete(id);
    }

    @Override
    public int deleteBatch(String[] ids) {
        return toolsRecordDao.deleteBatch(ids);
    }
}
